

public class WirePin implements Pin {
	private String name;
	private Wire parent;
	private ChipPin partner;
	
	@Override
	public WorkspaceObj getParent() {
		return parent;
	}

	@Override
	public void setParent(WorkspaceObj p_parent) {
		if(p_parent instanceof Wire) parent = (Wire) p_parent;
	}
	
	@Override
	public Pin getPartner() {
		return partner;
	}

	@Override
	public void setPartner(Pin p_partner) {
		if(p_partner instanceof ChipPin) partner = (ChipPin) p_partner;
	}
	
	@Override
	public Chip getChip() {
		if (partner.getParent() instanceof Chip){
			return (Chip) partner.getParent();
		}
		return null;
	}

	@Override
	public Wire getWire() {
		return parent;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String p_name) {
		name = p_name;
	}

	@Override
	public boolean isInput() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isOutput() {
		// TODO Auto-generated method stub
		return false;
	}
		
	public WirePin(String chipName, Wire wireParent, ChipPin chipPartner){
		name = chipName;
		parent = wireParent;
		partner = chipPartner;
	}

}
